<?php 
include 'lib/sessionCheck.php';

$p = $_GET['p'];

//cek tipe user
if ($_COOKIE_DATA->type == 1 && $_COOKIE_DATA->asAdmin){	//super user
	switch ($p){
		//master karyawan
		case 'karyawan': 		include 'view/admin/karyawan.php'; break;
		case 'divisi': 			include 'view/admin/divisi.php'; break;
		case 'departemen':		include 'view/admin/departemen.php'; break;
		case 'jabatan' :		include 'view/admin/jabatan.php'; break;
		case 'statusKaryawan':	include 'view/admin/statusKaryawan.php'; break;
		case 'golongan':		include 'view/admin/golongan.php'; break;
		case 'dataUser':		include 'view/admin/data_user.php'; break;

		//master reward dan punishment
		case 'rewarddanpunishment':			include 'view/admin/rewarddanpunishment.php'; break;
		case 'prestasipelanggaran':			include 'view/admin/prestasipelanggaran.php'; break;
		case 'detil_prestasipelanggaran':	include 'view/admin/detil_prestasipelanggaran.php'; break;
		case 'nilai':						include 'view/admin/nilai.php'; break;
		
		//transaksi
		case 'ranking':			include 'view/admin/ranking.php'; break;
		case 'perbuatan':		include 'view/admin/perbuatan.php'; break;
		
		//laporan grafik
		case 'total-point-karyawan':			include 'view/admin/totalPointKaryawan.php'; break;
		case 'total-point-departemen':			include 'view/admin/totalPointDepartemen.php'; break;
		case 'perolehan-reward-punishment':		include 'view/admin/perolehanRP.php'; break;
		case 'total-pelanggaran-departemen':	include 'view/admin/totalPelanggaranDepartemen.php'; break;
		case 'prestasi-pelanggaran-per-bidang':	include 'view/admin/prestasiPelanggaranPerBidang.php'; break;
		case 'total-point-perguruan-tinggi':	include 'view/admin/totalPointUniversitas.php'; break;
		case 'reward-punishment-perguruan-tinggi':	include 'view/admin/rewardPunishmentUniversitas.php'; break;
		
		default:				include 'view/admin/dashboard.php';
	}
}
else{
		 if ($p==='perbuatan') { 				include 'view/client/perbuatan.php'; }
	else { 										include 'view/client/dashboard.php'; }
}
